home *** CD-ROM | disk | FTP | other *** search
- Path: engnews1.Eng.Sun.COM!taumet!clamage
- From: clamage@Eng.sun.com (Steve Clamage)
- Newsgroups: comp.std.c++
- Subject: Re: and, or, not
- Date: 30 Jan 1996 16:31:03 GMT
- Organization: Sun Microsystems Inc.
- Approved: clamage@eng.sun.com (comp.std.c++)
- Message-ID: <4elgsk$ai1@engnews1.Eng.Sun.COM>
- References: <4ej3t4$7nb@jupiter.SJSU.EDU>
- Reply-To: clamage@Eng.sun.com
- NNTP-Posting-Host: taumet.eng.sun.com
- Content-Type: text
- X-Nntp-Posting-Host: taumet.eng.sun.com
- Content-Length: 1565
- X-Lines: 44
- Originator: clamage@taumet
-
- In article 7nb@jupiter.SJSU.EDU, horstman@jupiter.SJSU.EDU (Cay S. Horstmann) writes:
- >I just got a press release from Borland that says their upcoming 5.0
- >compiler will support keywords and, or, not, that are synonyms to &&,
- >|| and !.
-
- >They say you can use those if your local keyboard makes it difficult
- >to write the traditional tokens. Hell, my local eyes make it difficult
- >to read them. Does that mean I can from now on just write
- > if (0 <= x and x <= 1) . . .
- >and be in conformance with ANSI C++?
-
- Yes.
-
- >That is, are "and", "or", "not", now reserved words in ALL C++
- >programs,
-
- Yes. That is a difference from C, where they are macros in standard
- header file <iso646.h>.
-
- Those are not the only new replacements for the funny symbols. Here is
- a complete list, from section 2.4 "Alternative tokens" in the draft:
-
- Table 2 -- alternative tokens
- altern. primary altern. primary altern. primary
- <% { and && and_eq &=
- %> } bitor | or_eq |=
- <: [ or || xor_eq ^=
- :> ] xor ^ not !
- %: # compl ~ not_eq !=
- %:%: ## bitand &
-
- The alternative tokens and corresponding primary tokens are functionally
- equivalent; you can use either form in an expression, and you need not
- be consistent. The corresponding forms behave differently only when
- "stringized".
-
- The C++ Committee did not invent these, and asked for some of the more
- peculiar-looking items to be changed. But these are what was adopted
- by other ISO bodies, and it makes more sense to go along with them
- than to introduce incompatibilities.
- ---
- Steve Clamage, stephen.clamage@eng.sun.com
-
-
-
- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
- Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
- is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
-
-